<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="Dashboard">
  <meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
  <title>西安科技大学交通违章管理系统</title>

  <!-- 图标 -->
  <link href="img/favicon.png" rel="icon">
  <link href="img/apple-touch-icon.png" rel="apple-touch-icon">

  <!-- Bootstrap core CSS -->
  <link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <!--外部 css-->
  <link href="lib/font-awesome/css/font-awesome.css" rel="stylesheet" />
  <!-- 自定义样式 -->
  <link href="css/style.css" rel="stylesheet">
  <link href="css/style-responsive.css" rel="stylesheet">
  <link href="css/my.css" rel="stylesheet">
  <script src="lib/jquery/jquery.min.js"></script>
  <script src="layer/layer.js"></script>
</head>

<body>
  <div id="login-page">
    <div class="container">
      <form class="form-login" action="index.html">
        <h2 class="form-login-heading">管理员登录</h2>
        <div class="login-wrap">
          <input id="username" type="text" class="form-control" placeholder="用户名" autofocus>
          <br>
          <input id="password" type="password" class="form-control" placeholder="密码">
          <label  class="checkbox">
            <div style="margin-left : 20px;">
           <input id="remember" type="checkbox" value="remember_me"> 记住我
            <span class="pull-right">
            <a data-toggle="modal" href="login.html#myModal"> 忘记密码?</a>
            </span>
          </div>
            </label>
          <button class="btn btn-theme btn-block" id="commit" type="button"><i class="fa fa-lock"></i> 立即登录</button>
          <hr>
          <div class="login-social-link centered">
            <p><span style="color: red; font-size: 1em; font-weight: bold;">！</span>其他社交网络途径登录</p>
            <button class="btn btn-facebook" type="submit"><i class="fa fa-facebook" ></i> 企鹅</button>
            <button class="btn btn-twitter" type="submit"><i class="fa fa-twitter"></i> 微信</button>
            
          </div>
          <div class="registration">
            还没有账号<br/>
            <a class="" href="#">
              创建账号
              </a>
          </div>
        </div>
        <!-- Modal -->
        <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">忘记密码 ?</h4>
              </div>
              <div class="modal-body">
                <p>请输入注册时的手机号码.</p>
                <input type="text" name="email" placeholder="手机号" autocomplete="off" class="form-control placeholder-no-fix">
              </div>
              <div class="modal-footer">
                <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
                <button class="btn btn-theme" type="button">提交</button>
              </div>
            </div>
          </div>
        </div>
        <!-- modal -->
      </form>
    </div>
  </div>
  <script>
    $('#commit').click(function() {
      var remember = 0;
        var username = $('#username').val();
        var password = $('#password').val();
        if($('#remember').is(':checked'))
          remember = 1
        console.log(username,password,remember);
        $.post('/admin/login.udo', {
          username:username,
          password:password,
          remember:remember
        }, function (data) {
          console.log(data);
          var result = eval('(' + data + ')');
          if(result.status == 0) {
            location.href='/index.html';
          } else {
            layer.alert('登录名或者密码不正确');
          }
        });
    });
  </script>

  <script src="lib/bootstrap/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="lib/jquery.backstretch.min.js"></script>
  <script>

    $.backstretch("img/login-bg.jpg", {
      speed: 500
    });

  </script>
</body>

</html>
